//
//  ES1Renderer.h
//  MathMastersAsteroids
//
//  Created by Jordon Phillips on 3/1/10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//
//  The renderer for the game, based on the OpenGL es 1.1 template from the iphone sdk

#import "ESRenderer.h"
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import "Sprite.h"

@interface ES1Renderer : NSObject <ESRenderer>
{
@private
	EAGLContext *context;
	
	// The pixel dimensions of the CAEAGLLayer
	GLint backingWidth;
	GLint backingHeight;
	
	// The OpenGL names for the framebuffer and renderbuffer used to render to this view
	GLuint defaultFramebuffer, colorRenderbuffer;
	
	// texture array
	GLuint texture[22];
	
	//holds sprites to be rendered
	NSMutableArray* sprites;
}
- (void) loadTexture:(NSString *)name intoLocation:(GLuint)location;
- (void) render;
- (BOOL) resizeFromLayer:(CAEAGLLayer *)layer;
- (void) addSprite:(Sprite *)sprite;
- (void) setupTextures;

@end
